<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<% String basepaths = request.getContextPath(); %>
<%--<div id="location">当前位置：首页 > 招聘实施 > 中专校园招聘 > 毕业生推荐</div>--%>
<div id="Content">
<%--    <div class="btnbar">
        <button type="button" class="save" id="resume_ok">通过筛选</button>
        <button type="button" class="del" id="resume_no">未通过筛选</button>
        <button type="button" class="view" id="zzuser_view">查看毕业生信息</button>
        <button type="button" class="view" id="zzuser_edit">修改毕业生信息</button>
       &lt;%&ndash; <button type="button" class="list" id="zzuser_give">部门划分</button>&ndash;%&gt;
        <button type="button" class="card" id="do_zzopen">开启</button>
        <button type="button" class="card" id="do_zzclose">关闭</button>
        <button type="button" class="list" id="do_zznext">进入下一步</button>
        <button type="button" class="del" id="resumeCheck_no">批量未通过筛选</button>
        &lt;%&ndash;<button type="button" class="del" id="repetition_clear">重复简历筛选</button>&ndash;%&gt;
        <button type="button" class="save" id="resume_output">导出</button>
        <button type="button" class="save" id="resume_input">导入</button>
        <button type="button" class="list" id="do_tjgw" pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位</button>
    </div>--%>
    <div class="toolbars" style="height:30px;white-space:nowrap;width:auto;margin-left: 10px;" totalwidth="314">
        <a id="resume_ok">
            <em class="ico16 gone_through_16"></em>
            <span class="menu_span" title="通过筛选">通过筛选</span>
        </a>
        <a id="resume_no" style="margin-left: 5px">
            <em  class="ico16 stop_contract_16"></em>
            <span  class="menu_span" title="未通过筛选">未通过筛选</span>
        </a>
        <a id="zzuser_view" style="margin-left: 5px">
            <em  class="ico16 view_attachments_16"></em>
            <span  class="menu_span" title="查看毕业生信息">查看毕业生信息</span>
        </a>
        <a id="zzuser_edit" style="margin-left: 5px">
            <em  class="ico16 sort_text_16"></em>
            <span  class="menu_span" title="修改毕业生信息">修改毕业生信息</span>
        </a>
        <a id="do_zzopen" style="margin-left: 5px">
            <em  class="ico16 taskTree_open_16"></em>
            <span  class="menu_span" title="开启">开启</span>
        </a>
        <a id="do_zzclose" style="margin-left: 5px">
            <em  class="ico16 close_16"></em>
            <span  class="menu_span" title="关闭">关闭</span>
        </a>
        <a id="do_zznext" style="margin-left: 5px">
            <em  class="ico16 more_blue"></em>
            <span  class="menu_span" title="进入下一步">进入下一步</span>
        </a>
        <a id="resume_sendmsg" style="margin-left: 5px">
            <em  class="ico16 common_language_16"></em>
            <span  class="menu_span" title="发短信">发短信</span>
        </a>
        <a id="resumeCheck_no" style="margin-left: 5px">
            <em  class="ico16 hover_close_16"></em>
            <span  class="menu_span" title="批量未通过">批量未通过</span>
        </a>
        <a id="resume_output" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_down"></em>
            <span  class="menu_span" title="导出">导出</span>
        </a>
        <a id="resume_input" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_up"></em>
            <span  class="menu_span" title="导入">导入</span>
        </a>
        <a id="do_tjgwNew" style="margin-left: 5px">
            <em  class="ico16 otherevent_16"></em>
            <span  class="menu_span" title="转岗"  pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位</span>
        </a>
        <a id="resume_down_zip" style="margin-left: 5px" >
            <em  class="ico16 download_16"></em>
            <span  class="menu_span" title="下载简历">下载简历</span>
        </a>
        <a id="send_news" style="margin-left: 5px">
            <em  class="ico16 info_16"></em>
            <span  class="menu_span" title="消息通知">消息通知</span>
        </a>
    </div>

    <!-- 消息通知 -->
    <div id="infospanel"  class="condition_cont">
        <form id="infosform" method="post" action="/Do/SendInfos/SendInfosAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="100">消息内容:</td>
                    <td width="500">
                        <div><textarea name="infoContent" datatype="*" nullmsg="消息内容不能为空！"></textarea></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="op">发送消息通知</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="infosuers"></div>
            <div id="infosuerCardnos"></div>
        </form>
    </div>

    <!-- 筛选条件 -->
    <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="pid" value="${pid}"/>
            <input type="hidden" name="path" value="${fid}"/>
            <input type="hidden" name="deptcode" value="${deptcode}"/>
           <%-- <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">学校名称：</td>
                    <td width="200">
                        <div><select name="adduid">${school}</select></div>
                    </td>
                    <td width="60">学生姓名：</td>
                    <td width="150">
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td width="60">身份证号：</td>
                    <td width="150">
                        <div><input type="text" name="code"/></div>
                    </td>
                    <td width="40"></td>
                    <td></td>
                </tr>
                <tr>
                    <td>审核状态：</td>
                    <td>
                        <div>
                            <select name="state">
                                <option value="-1">全部</option>
                                <option value="0">待审核</option>
                                <option value="1">审核中</option>
                                <option value="2">已通过</option>
                                <option value="3">未通过</option>
                            </select>
                        </div>
                    </td>
                    <td>所学专业：</td>
                    <td>
                        <div><input type="text" name="major"/></div>
                    </td>
                    <td>责任部门：</td>
                    <td>
                        <div><input type="text" name="deptname"/></div>
                    </td>
                    <td>
                        <button id="searchbtn" type="button" class="search"></button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>--%>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">毕业院校:</td>
                    <td width="160">
                        <div>
                            <select name="adduid">
                            <option value="">全部</option>
                            ${school}
                            </select>
                        </div>
                    </td>
                    <td width="60">身份证号:</td>
                    <td>
                        <div><input type="text" name="code"/></div>
                    </td>
                    <td width="60">姓名:</td>
                    <td >
                        <div>
                            <input type="text" name="name"/>
                        </div>
                    </td>
                    <td width="60">所学专业:</td>
                    <td >
                        <div>
                            <input type="text" name="major"/>
                        </div>
                    </td>
                    <td width="60">毕业年份:</td>
                    <td>
                        <div><input type="text" name="graduationyear"/></div>
                    </td>
                </tr>
                <tr>
                    <td width="60">联系电话:</td>
                    <td>
                        <div>
                            <input type="text" name="tel"/>
                        </div>
                    </td>
                    <td width="60">岗位组:</td>
                    <td >
                        <div>
                            <select name="job">
                            <option value="">不限</option>
                            <c:forEach var="projectinfojobs" items="${jobs}" varStatus="item" >
                                <c:choose>
                                    <c:when test="${projectinfojobs!=null}">
                                        <option value="${projectinfojobs.jobname}">${projectinfojobs.jobname}</option>
                                    </c:when>

                                </c:choose>
                            </c:forEach>
                        </select>
                        </div>
                    </td>
                    <td width="60">个人信息:</td>
                    <td width="100">
                        <div> <select name="state">
                            <option value="">不限</option>
                            <option value="2">已通过</option>
                            <option value="3">未通过</option>
                        </select></div>
                    </td>
                    <td width="60">筛选状态:</td>
                    <td width="100">
                        <div>
                            <select name="rstate">
                                <option value="">全部</option>
                                <option value="未处理">未处理</option>
                                <option value="已通过">已通过</option>
                                <option value="未通过">未通过</option>
                            </select>
                        </div>
                    </td>
                    <td width="60">放弃状态:</td>
                    <td width="100">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                </tr>
                <tr class="moretj">

                    <td width="60">性别:</td>
                    <td width="150">
                        <div>
                            <select name="gender">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>
                    <td width="60" style="text-align:right;">年龄:</td>
                    <td width="150">
                        <div><input type="text" name="agefrom" style="max-width: 40%"/>至<input type="text" name="ageto" style="max-width: 40%"/></div>
                    </td>
                    <td width="60" style="text-align:right;">身高:</td>
                    <td width="150">
                        <div><input type="text" name="heightfrom" style="max-width: 40%"/>至<input type="text" name="heightto" style="max-width: 40%"/></div>
                    </td>
                    <td width="60">是否转岗:</td>
                    <td width="100">
                        <div>
                            <select name="ischangejob">
                                <option value="">全部</option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                        </div>
                    </td>
                    <td colspan="3"></td>
                </tr>
                <%--<tr class="moretj">
                    <td>性别:</td>
                    <td>
                        <div>
                            <select name="gender">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>

                    <td>户口所在地:</td>
                    <td>
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td colspan="3">
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td>筛选状态:</td>
                    <td colspan="3">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>--%>
                <tr>
                    <td colspan="2">
                 <%--       <div style="padding-top: 8px;"> <button id="searchbtn" type="button" class="search"></button>
                            <button id="clearbtn" type="reset" class="del" title="清除" style="flex: 1;margin-left: 5px;"></button>
                        </div>--%>
                     <div class="toolbars">
                         <a id="searchbtn">
                             <em class="ico16 search_16"></em>
                             <span >查询</span>
                         </a>
                         <a id="clearbtn">
                             <em class="ico16 refresh_16"></em>
                             <span>清除</span>
                         </a>
                     </div>
                    </td>
                    <td colspan="11">
                 <%--       <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>--%>
                     <div class="toolbars">
                         <a onclick="moreparam()">
                             <em class="ico16 search_disable_16"></em>
                             <span >高级查询</span>
                         </a>
                     </div>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>

    <!-- 部门划分 -->
    <form id="deptform" method="post" action="${path}/Do/ZZRecommend/DeptAction">
        <input type="hidden" name="pid" value="${pid}"/>
        <div id="deptpanel" class="condition_cont">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">责任部门：</td>
                    <td width="300">
                        <div>
                            <input type="hidden" name="zrdeptcode" id="deptcode"/>
                            <input type="text" name="zrdeptname" id="deptname" class="select" onFocus="blur()"
                                   datatype="*" nullmsg="请选择责任部门！"/>
                        </div>
                    </td>
                    <td width="60">
                        <button type="submit" class="save">提 交</button>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="4" style="text-align:left; letter-spacing:2px;">
                        系统提示：只有 “待审核” 和 “审核中” 两种状态下的毕业生信息可以完成部门划分
                    </td>
                </tr>
                </thead>
            </table>
        </div>
    <%--    <div id="page_top" class="page"></div>
        <table class="treeTable" id="tablelist">
            <thead>
            <tr>
                <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
                <td width="35">序号</td>
                <td width="60">姓名</td>
                <td width="40">性别</td>
                <td width="120">身份证号</td>
                <td>所学专业</td>
                <td width="90">毕业时间</td>
                <td width="60">在校表现</td>
                <td width="60">学历起点</td>
                <td width="40">身高</td>
                <td width="60">岗位</td>
                <td width="60">个人信息</td>
                <td width="60">筛选状态</td>
                <td width="40">备注</td>
                <td width="50"></td>
            </tr>
            </thead>
            <tbody id="result"></tbody>
        </table>
    </form>
    <div id="page_bottom" class="page"></div>--%>
        <table class="layui-hide" id="tablelistZZRecommend" lay-filter="listTables"></table>
</div>
<script src="../../../resources/js/plugins/layui/layui.all.js" type="text/javascript"></script>
<script type="text/javascript">
    $("#searchbox").width($(window).width()-10);
    var nowflow="${nowflow}";

    var ptypes = "ZZRecommend";

    //消息通知
    $('#send_news').on('click',function () {
        getTableChecks();

        $('#infospanel').slideToggle(300);
        $(this).toggleClass('cur').blur().siblings().removeClass('cur');
    });

    var selectDataTemp = [];
    function getTableChecks(){
        var selectData = layui.table.checkStatus('listTables').data;

        if(selectDataTemp.length > 0){
            for(var i=0;i<selectDataTemp.length;i++){
                $('#infosuers input').each(function () {
                    if ($(this).val() == selectDataTemp[i].id_cb.replace('cb_', ''))
                        $(this).remove();
                });
                $('#infosuerCardnos input').each(function () {
                    if ($(this).val() == selectDataTemp[i].CARDNO)
                        $(this).remove();
                });
            }
        }
        if(selectData.length == 0){
            selectDataTemp = selectData;
        }else{
            for(var i=0;i<selectData.length;i++){
                $('#infosuers').append('<input type="hidden" name="id" value="' + selectData[i].id_cb.replace('cb_', '') + '"/>');
                $('#infosuerCardnos').append('<input type="hidden" name="cardno" value="' + selectData[i].CARDNO + '"/>');
            }
            selectDataTemp = selectData;
        }
    }

    var pageobj = null;
    $(document).ready(function () {
       // getList();
/*        $('#searchbtn').click(function () {
            getList();
        });*/
        /*$('#searchbtn').on('click',function () {
            getList();
        });*/

        $('#clearbtn').on('click',function () {
            document.getElementById("sform").reset();
        });

        $('#zzuser_give').click(function () {
            $('#deptpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
        });

        $('#deptname').click(function () {
            openpLayer('选择责任部门', '/SysAdmin/getdepts', '90%', '98%');
        });

        $("#deptform").Validform({
            ajaxPost: true,
            callback: function (data) {
               // $.Showmsg(data.Message);
                parent.layer.alert(data.Message);
                if (data.state) {
                  //--  getList();
                    tableRenders();
                }
            }
        });

        $('#do_zzopen').click(function () {
            parent.layer.confirm('开启以后中专院校可以推荐毕业生。<br>确定要开启吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/Do/ZZRecommend/OpenCloseAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                postAjax(url, null, function (data) {
                    //$.Showmsg(data.Message);
                    if (data.state) {
                        layer.msg(data.Message, {icon: 1});
                    }else {
                        layer.msg(data.Message, {icon: 2});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });

        $('#do_zzclose').click(function () {
            parent.layer.confirm('关闭以后中专院校不能推荐毕业生。<br>确定要关闭吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/Do/ZZRecommend/OpenCloseAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                postAjax(url, null, function (data) {
                   // $.Showmsg(data.Message);
                    if (data.state) {
                        layer.msg(data.Message, {icon: 1});
                    }else {
                        layer.msg(data.Message, {icon: 2});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });
        $('#resume_no').click(function () {
            var id = '';
            var selectData = layui.table.checkStatus('listTables').data;
            if(selectData.length == 0){
                parent.layer.alert('请选择一条信息!', {icon: 2});
            }else if(selectData.length > 1){
                parent.layer.alert('只能选择一条信息!',{icon:2});
            }else{
                id = selectData[0].id_cb.replace('cb_', '') + '';
                openpLayer('简历筛选未通过', '/Do/ZZResume/bz?id=' + id + '&pid=${pid}&fid=${fid}&deptcode=${deptcode}', '500px', '200px');
            }
        });

        $('#resumeCheck_no').click(function(){
            // var checkRows=$('#tablelist tbody input[type=checkbox]:checked');
            var ids ='';

            var selectData = layui.table.checkStatus('listTables').data;
            if(selectData.length == 0){
                parent.layer.alert('至少选择一条信息!', {icon: 2});
            }else{
                for(var i=0;i<selectData.length;i++){
                    ids += selectData[i].id_cb.replace('cb_', '') + ',';
                }
                parent.layer.prompt({title: '请填写未通过原因，并确认', formType: 2}, function(text, index){
                    parent.layer.close(index);
                    $.post("/Do/ZZResume/ResumeAllNoAction"
                        ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",ids:ids,sxbz:text}
                        ,function (result) {
                            if (result.state) {
                                //$.Showmsg(result.Message);
                                layer.msg(result.Message, {icon: 1});
                                tableRenders();
                            }
                            else {
                                //$.Showmsg(result.Message);
                                layer.msg(result.Message, {icon: 2});
                            }
                        }
                        ,"json");
                });
            }
        });

        $('#do_zznext').click(function () {
            parent.layer.confirm('只能将本部门负责招聘实施的信息提交到下一步<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                toNextFlowNew('/Do/ZZRecommend/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}');
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });
    });
    $('#resume_sendmsg').click(function () {
        var ids = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('请选择一条信息!', {icon: 2});
        }else{
            for(var i=0;i<selectData.length;i++){
                ids += selectData[i].id_cb.replace('cb_', '') + ',';
            }
            parent.layer.confirm('将会对已发布信息发送短信。<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/DUserResume/SendMessageAction';
                postAjax(url, {pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",ids:ids}, function (data) {
                    if (data.state) {
                        parent.layer.alert(data.Message, {icon: 1,time:5000});
                        tableRenders();
                        var Timer = setTimeout(changeToNextTab(nowflow),500);
                        clearTimeout(1);
                    }
                    else {
                        parent.layer.alert(data.Message, {icon: 2,time:5000});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });

        }
    });

  /*  function getList() {
        pageobj =   $('.page').myPagination({
            cssStyle: "pagination",
            saveChecked:true,
            showTitle:false,
            rowNumber:false,
            contextMenu:true,
            contextMenuParam:{
                menu: [{
                    text: "情况说明",
                    callback: function(ele) {
                        console.log($(this))
                        var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                        var cardno=ele[0].cells[4].innerText;
                        var rname=ele[0].cells[2].innerText;
                        parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 个人情况说明，并确认', formType: 2}, function(text, index){
                            parent.layer.close(index);
                            var cid=tcid.replace('cb_','');
                            $.post("/Do/ZZResume/ResumeRemark"
                                ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",id:cid,userremark:text}
                                ,function (result) {
                                    if (result.state) {
                                        $.Showmsg(result.Message);
                                        getList();
                                    }
                                    else {
                                        $.Showmsg(result.Message);
                                    }
                                }
                                ,"json");
                        });
                        //alert("ID;"+tcid+"情况说明");
                    }
                },
                    {
                        text: "通过",
                        callback: function(ele) {
                            var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                            var cardno=ele[0].cells[4].innerText;
                            var rname=ele[0].cells[2].innerText;
                            var cindex=  parent.layer.confirm('姓名:'+rname+"<br/>身份证:"+cardno+'<br/>是否确认通过?<br/>',{icon:3,title:'提示'},function () {
                                var url = '/Do/ZZResume/ResumeOkAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                                var cid=tcid.replace('cb_','');
                                postAjax(url, {id:cid}, function (data) {
                                    if (data.state) {
                                        parent.layer.msg(data.Message,{icon:1,time:2000});
                                        getList();
                                    }
                                    else {
                                        parent.layer.msg(data.Message,{icon:2,time:2000});
                                    }
                                });
                            },function () {
                               layer.close(cindex);
                           });
                        }
                    },
                    {
                        text: "不通过",
                        callback: function(ele) {
                            var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                            var cardno=ele[0].cells[4].innerText;
                            var rname=ele[0].cells[2].innerText;
                            parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 未通过原因，并确认', formType: 2}, function(text, index){
                                parent.layer.close(index);
                                var cid=tcid.replace('cb_','');
                                $.post("/Do/ZZResume/ResumeNoAction"
                                    ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",id:cid,sxbz:text}
                                    ,function (result) {
                                        if (result.state) {
                                            $.Showmsg(result.Message);
                                            getList();
                                        }
                                        else {
                                            $.Showmsg(result.Message);
                                        }
                                    }
                                    ,"json");
                            });
                        }
                    },
                    {
                        text: "查看推荐信息",
                        callback: function(ele) {
                            var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                            var cid=tcid.replace('cb_','');
                            if(!!cid){
                                var url='/Do/ZZRecommend/view?_x=2015&id='+cid;
                                parent.layer.open({
                                    type: 2,
                                    title: '查看推荐信息',
                                    shade: 0.5,
                                    area: ['800px', '600px'],
                                    content: encodeURI(url)
                                });
                            }
                        }
                    },
                    {
                        text: "查看个人简历",
                        callback: function(ele) {
                            var url=$(ele).find('a').attr('href');
                            if(!!url){
                                window.open(url);
                            }
                        }
                    },
                    {
                        text: "刷新列表",
                        callback: function() {
                            getList()
                        }
                    }
                ]
            },
            ajax: {
                on: true,
                url: '${path}/Do/ZZRecommend/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                    $('#result').html(data);
                    parent.changeFrameHeight();
                    $('#result a').click(function () {
                        event.stopPropagation();
                    });
                }
            }
        });
    }*/

    function reloadData() {
        pageobj.onReload();
    }
    //$(function () {


        $('#resume_ok').click(function () {
            var url = '/Do/ZZResume/ResumeOkAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
            DelInfoNew(url);
        });

        /*$('#do_zznext').click(function () {
            parent.layer.confirm('未通过简历筛选的应聘者不能进入下一步，是否继续？', {
                btn: ['是', '否']
            }, function () {
                //DelInfo('/Do/ZZResume/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}');
                toNextFlowNew('/Do/ZZResume/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}','${fid}');
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });

        });*/
  //  });
    $(function () {
        $('#resume_output').click(function () {
            openpLayer('请选择要导出的字段', '/ExcelDown/DownDoResumeBySearch?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');
        });
        $('#resume_input').click(function () {
            openpLayer('Excel数据导入', '/ExcelImport/ImportExcelPage?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '500px');
        });
    });

    $(function () {
        fillSelectState("rstate","${fid}");
    })

    var ZzRecommendTable;
    var sdat;

    layui.config({
        base: '<%=basepaths%>/resources/js/plugins/ext/',   // 模块目录
        version: 'v1.5.10' // 插件版本号
    }).extend({
        soulTable: 'soulTable',// 模块别名
        tableChild: 'tableChild',
        tableMerge: 'tableMerge',
        tableFilter: 'tableFilter',
        // excel: 'excel',
    });

    layui.use(['table','soulTable','tableChild','tableMerge','tableFilter'], function(){
        var soulTable = layui.soulTable,
            tableChild = layui.tableChild,
            tableMerge = layui.tableMerge,
            tableFilter = layui.tableFilter,
            $ = layui.$;

        ZzRecommendTable = layui.table;
        sdat = '${path}/Do/ZZRecommend/getZZRecommendListLayuiJson?flowid=${fid}&'+$('#sform').serialize();

        ZzRecommendTable.render({
            id:'listTables'
            ,elem: '#tablelistZZRecommend'
            ,url: sdat
            ,title:'用户数据表'
            , height: 'full'
            //  ,cellMinWidth: 40 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,contextmenu: {
                // 表格内容右键菜单配置
                body: [
                    {
                        name: '情况说明', // 显示的菜单名
                        click: function(obj) { //点击事件
                            //   console.log(obj.row) // 当前行数据
                            var tcid = obj.row.id_cb;
                            var cardno = obj.row.CARDNO;
                            var rname = obj.row.NAME;
                            parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 个人情况说明，并确认', formType: 2}, function(text, index){
                                parent.layer.close(index);
                                var cid=tcid.replace('cb_','');
                                $.post("/Do/ZZResume/ResumeRemark"
                                    ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",id:cid,userremark:text}
                                    ,function (result) {
                                        if (result.state) {
                                            parent.layer.msg(result.message,{icon:1});
                                            tableRenders();
                                        }
                                        else {
                                            parent.layer.msg(result.message,{icon:2});
                                        }
                                    }
                                    ,"json");
                            });
                        }
                    }
                    ,{
                        name: '通过', // 显示的菜单名
                        click: function(obj) { //点击事件
                            var tcid = obj.row.id_cb;
                            var cardno = obj.row.CARDNO;
                            var rname = obj.row.NAME;

                            var cindex=  parent.layer.confirm('姓名:'+rname+"<br/>身份证:"+cardno+'<br/>是否确认通过?<br/>',{icon:3,title:'提示'},function () {
                                var url = '/Do/ZZResume/ResumeOkAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                                var cid=tcid.replace('cb_','');
                                postAjax(url, {id:cid}, function (data) {
                                    if (data.state) {
                                        parent.layer.msg(data.Message,{icon:1});
                                        tableRenders();
                                    }
                                    else {
                                        parent.layer.msg(data.Message,{icon:2});
                                    }
                                });
                            },function () {
                                layer.close(cindex);
                            });
                        }
                    }
                    ,{
                        name: '不通过', // 显示的菜单名
                        click: function(obj) { //点击事件
                            var tcid = obj.row.id_cb;
                            var cardno = obj.row.CARDNO;
                            var rname = obj.row.NAME;

                            parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 未通过原因，并确认', formType: 2}, function(text, index){
                                parent.layer.close(index);
                                var cid=tcid.replace('cb_','');
                                $.post("/Do/ZZResume/ResumeNoAction"
                                    ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",id:cid,sxbz:text}
                                    ,function (result) {
                                        if (result.state) {
                                            parent.layer.msg(result.Message,{icon:1});
                                            tableRenders();
                                        }
                                        else {
                                            parent.layer.msg(result.Message,{icon:2});
                                        }
                                    }
                                    ,"json");
                            });
                        }
                    }
                    ,{
                        name: "查看个人简历",// 显示的菜单名
                        click: function(obj) { //点击事件
                            var url = obj.row.ContextPath;
                            if(!!url){
                                window.open(url);
                            }
                        }
                    }
                    ,{
                        name: "刷新列表",// 显示的菜单名
                        click: function(obj) { //点击事件
                            tableRenders();
                        }
                    }
                ]
            }

            ,cols: [[
                {type:'checkbox',fixed:'center'}
                ,{field:'id', title: '序号', fixed:'center',sort: true}
                ,{field:'NAME',title: '姓名', fixed:'left',sort: true,minWidth:100,templet: function(d){
                        if(d.cardcount>1){
                            return '<a target="_blank" href="' + d.ContextPath + '">' +d.NAME+
                                '</a>&nbsp;<span class="layui-badge">'+d.cardcount+'</span>';
                        }else{
                            return '<a target="_blank" href="' + d.ContextPath + '">' +d.NAME;
                        }
                    }}
                ,{field:'SEXNAME',title: '性别', fixed:'center'}
                ,{field:'CARDNO',title: '身份证号', fixed:'center',minWidth:160}
                ,{field:'MAJORNAME', title: '所学专业', fixed:'center', sort: true,minWidth:160}
                ,{field:'GRADUATIONTIME', title: '毕业时间', fixed:'center', sort: true}
                ,{field:'BX', title: '在校表现', fixed:'center', sort: true}
                ,{field:'GUAKE', title: '有无挂科', fixed:'center', sort: true}
                ,{field:'HEIGHT', title: '身高', fixed:'center', sort: true}
                ,{field:'JOB', title: '岗位', fixed:'center', sort: true}
                ,{field:'STATEa', title: '个人信息', fixed:'center', sort: true,templet: function(d) {
                        if (d.STATEa == "已通过")
                            return '<span>'+d.STATEa+'</span>';
                        else
                            return '<span style="color:red">'+d.STATEa+'</span>';
                    }}
                ,{field:'STATEb', title: '筛选状态', fixed:'center', sort: true,templet: function(d) {
                        if (d.STATEb == "未通过")
                            return '<span style="color:red">'+d.STATEb+'</span>';
                        else
                            return '<span>'+d.STATEb+'</span>';
                    }}
                ,{field:'RMARKS', title: '备注', fixed:'center', sort: true}
                ,{field:'STATEc',  title: '', fixed:'center',templet: function(d){
                        switch(d.STATEc){
                            case "弃" :
                                return '<span class="layui-badge layui-bg-gray" title="已放弃">'+d.STATEc+'</span>';
                                break;
                            case "未" :
                                return '<span class="layui-badge layui-bg-orange" title="未完成">'+d.STATEc+'</span>';
                                break;
                            case "完" :
                                return '<span class="layui-badge layui-bg-green">'+d.STATEc+'</span>';
                                break;
                            default: '<span></span>'; break;
                        }}}
                ,{field:'STATEd',  title: '', fixed:'center',templet: function(d){
                        if(d.NRID != "")
                            return   '<span class="layui-badge layui-bg-blue" title="转岗(原岗位:'+d.NJNAME+'")>'+d.STATEd+'</span>';
                        else
                            return '<span></span>';
                    }}
            ]]
            ,page: true
            , done: function () {
                soulTable.render(this);
            }
        });

        $("#searchbtn").on('click', () => {
            tableRenders();
        });
    });

    function tableRenders() {
        sdat = '${path}/Do/ZZRecommend/getZZRecommendListLayuiJson?flowid=${fid}&'+$('#sform').serialize();
        //执行重载
        ZzRecommendTable.reload('listTables', {
            url: sdat
            ,method: 'get'
            ,page:  {
                curr: 1 //重新从第 1 页开始
            }
            ,where: {
            }
        }, 'data');
    }


</script>
</body>
</html>